package cn.gson.crmdemo.common;

import lombok.Data;

@Data
public class JsonResult {

    private Boolean success=true;

    private String msg;

    public JsonResult(){

    }
    public JsonResult(String msg){
        this.msg=msg;
    }

    public static JsonResult success(){
        return new JsonResult();
    }

    public static JsonResult success(String msg){
        return new JsonResult(msg);
    }

    public static JsonResult error(){
        JsonResult jsonResult=new JsonResult();
        jsonResult.setSuccess(false);
        return jsonResult;
    }

    public static JsonResult error(String msg){
        JsonResult jsonResult=new JsonResult(msg);
        jsonResult.setSuccess(false);
        return jsonResult;
    }

}
